package com.lemner.ke.adapter;

import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.lemner.ke.R;
import com.lemner.ke.base.URL;
import com.lemner.ke.bean.RichEntityBean;
import com.lemner.ke.bean.VideoCommentBean;
import com.lemner.ke.util.LoadImageUtils;

import java.util.List;

public class DetailAdapter extends BaseQuickAdapter<VideoCommentBean.DataBean.ListBean,BaseViewHolder>{
    public DetailAdapter(int layoutResId) {
        super(layoutResId);
    }

    public DetailAdapter(int layoutResId, @Nullable List<VideoCommentBean.DataBean.ListBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, VideoCommentBean.DataBean.ListBean item) {
        if (item!=null){
            if (item.getNames()!=null){
                helper.setText(R.id.tv_item_play__user_name,item.getNames());
            }
            if (item.getCreatetime()!=null){
                helper.setText(R.id.tv_item_play_time,item.getCreatetime());
            }
            if (item.getContent()!=null){
                helper.setText(R.id.tv_item_play_comment_massage,item.getContent());
            }
            if (item.getHead()!=null){
                LoadImageUtils.loadImage(URL.BASE_URL + item.getHead(), (ImageView) helper.getView(R.id.civ_item_play__head));
            }

        }

        helper.addOnClickListener(R.id.iv_item_play_down_point);


    }

}
